package ee.homework.third;

public class BitTest {
	public static void main(String[] args) {
		new BitTest().run();
	}

	private void run() {
		System.out.println((639 & 128));
//		 System.out.println(getBits(6));
	}

	private String getBits(int value) {
		int displayMask = 1 << 7;
		StringBuffer buf = new StringBuffer(35);
		System.out.println(displayMask);
		for (int c = 1; c <= 8; c++) {
			System.out.println(value + ", " + (value & displayMask));
			buf.append((value & displayMask) == 0 ? '0' : '1');
			value <<= 1;

			if (c % 8 == 0)
				buf.append(' ');
		}

		return buf.toString();
	}
}
